// SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
// SPDX-License-Identifier: Apache-2.0

package resource_dao

import "go.mongodb.org/mongo-driver/v2/mongo"

var ResourceInfoDao *_ResourceInfoDao
var CardInfoDao *_CardInfoDao
var CardLinkDao *_CardLinkDao
var CardStateDao *_CardStateDao
var QuestionInfoDao *_QuestionInfoDao
var QuestionStateDao *_QuestionStateDao

func InitDao(mgoDb *mongo.Database) (err error) {
	ResourceInfoDao, err = newResourceInfoDao(mgoDb)
	if err != nil {
		return
	}
	CardInfoDao, err = newCardInfoDao(mgoDb)
	if err != nil {
		return
	}
	CardLinkDao, err = newCardLinkDao(mgoDb)
	if err != nil {
		return
	}
	CardStateDao, err = newCardStateDao(mgoDb)
	if err != nil {
		return
	}
	QuestionInfoDao, err = newQuestionInfoDao(mgoDb)
	if err != nil {
		return
	}
	QuestionStateDao, err = newQuestionStateDao(mgoDb)
	if err != nil {
		return
	}
	return
}
